﻿<%@ Page Language="C#" MasterPageFile="~/Shared/DialogPage.Master" AutoEventWireup="true" CodeBehind="AccessoryReplacementApprove.aspx.cs" Inherits="Runda.CMS.Portal.StockManagement.AccessoryReplacementApprove" StylesheetTheme="GlobleTheme"%>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <script src="../Content/global.js" type="text/javascript"></script>
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
       <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" /> 

    <script src="../Content/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../Content/jquery.numeral.js" type="text/javascript"></script>
    
<script type="text/javascript">
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow;
        return oWindow;
    }

    function CloseWindow() {
        var oWindow = GetRadWindow();
        oWindow.Argument = '';
        oWindow.Close();
    }

    function SaveAndCloseWindow() {
        var oWindow = GetRadWindow();
        oWindow.Argument = 'changed';
        oWindow.Close();
    }

    function SaveAndCloseWindow1(arg) {
        var oWindow = GetRadWindow();
        oWindow.Argument = arg;
        oWindow.Close();
    }

    function OnSelectAccessoryCallback(radWindow) {
        if (radWindow != undefined) {
            if (radWindow.Argument != '' && radWindow.Argument != null) {
                if (radWindow.Argument[0] != undefined) {
                    document.getElementById('<%=txtAccessaryID.ClientID %>').value = radWindow.Argument[0];
                    document.getElementById('<%=txtAccssoryCode.ClientID %>').value = radWindow.Argument[1];
                    document.getElementById('<%=txtAccessaryName.ClientID %>').value = radWindow.Argument[2];

                    document.getElementById('<%=txtStock.ClientID %>').value = radWindow.Argument[3];
                    document.getElementById('<%=txtAccessoryVendor.ClientID %>').value = radWindow.Argument[4];
                }
            }
        }
    }

    $(function() {
        $('#<%=txtQuotePrice.ClientID %>').numeral();
        $('#<%=txtReplacementNum.ClientID %>').numeral();

        $('#<%=txtAccssoryCode.ClientID %>').attr('readonly', 'readonly');
        $('#<%=txtAccessaryName.ClientID %>').attr('readonly', 'readonly');
        $('#<%=txtStock.ClientID %>').attr('readonly', 'readonly');
        $('#<%=txtAccessoryVendor.ClientID %>').attr('readonly', 'readonly');

        $('#<%=btnSave.ClientID %>').click(function() {

            if ($('#<%=txtAccessaryID.ClientID %>').val() == '') {
                alert('请选择配件!');
                return false;
            }
            if ($('#<%=txtReplacementNum.ClientID %>').val() == '') {
                alert('请输入更换数量!');
                return false;
            }

            if ($('#<%=txtQuotePrice.ClientID %>').val() == '') {
                alert('请输入报价金额!');
                return false;
            }
            return true;
        });
    })
    
    function AccessorySelect() {
        radopen('../ContractFollowUp/AccessorySelectByInstrument.aspx?RegisterID=' + document.getElementById('<%=hiddenRegisterID.ClientID %>').value + '&MaintainID=' + document.getElementById('<%=hiddenMaintainID.ClientID %>').value, 'SelectAccessory');
        return false;
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <rad:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>  
        <rad:RadWindow ID="SelectAccessory" runat="server" Title="选择配件及耗材" Height="400px" Width="500px" ReloadOnShow="true" Modal="true" OnClientClose="OnSelectAccessoryCallback"/> 
    </Windows>
</rad:RadWindowManager>

    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>配件及耗材列表</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap> 
                </td>
                <td class="icMenu mnuRight" nowrap> 
                </td>
            </tr>
        </tbody>
    </table> 
    <div style="display: inline" id="appForm_tab0" class="tab">
           <table border="0" width="100%">
        <colgroup>
        <col width="15%"/>
        <col width="35%"/>
        <col width="15%"/>
        <col width="35%"/>
        </colgroup>
            <tr><td>配件及耗材编号</td><td>
                <asp:TextBox ID="txtAccssoryCode" runat="server" Width="200px" ></asp:TextBox>
                <img class="lu2" alt="" src="/Images/btn_off_lookup.gif" style="cursor:hand" onclick="AccessorySelect();"/>
                </td><td>配件及耗材名称</td><td>
                <asp:TextBox ID="txtAccessaryName" runat="server" ></asp:TextBox>
                             <asp:HiddenField runat="server" ID="txtAccessaryID" />
                </td></tr>
            <tr><td>当前库存</td><td>
                            <asp:TextBox ID="txtStock" runat="server"></asp:TextBox>
                            </td><td>配件所属公司</td><td>
                            <asp:TextBox ID="txtAccessoryVendor" runat="server"></asp:TextBox>
                            </td></tr>
            <tr><td>更换数量</td><td>
                <asp:TextBox ID="txtReplacementNum" runat="server"></asp:TextBox>
                </td><td>报价金额</td><td>
                <asp:TextBox ID="txtQuotePrice" runat="server"></asp:TextBox>
                </td></tr>
            <tr><td>更换属于</td><td>
                            <asp:DropDownList ID="ddlBelongto" runat="server">
                            </asp:DropDownList>
                </td><td>类型</td><td>
                            <asp:DropDownList ID="ddlAccessoryPaymentStatus" runat="server">
                            <asp:ListItem Text="公司付" Value="0"></asp:ListItem>
                            <asp:ListItem Text="客户付" Value="1"></asp:ListItem>
                            </asp:DropDownList>
                </td></tr>
            <tr><td>收费对象</td><td>
            <asp:DropDownList ID="ddlPaymentsObject" runat="server">
                </asp:DropDownList>
                </td><td>收费对象说明</td><td> 
                    <asp:TextBox ID="txtPaymentsObjectDesc" runat="server"></asp:TextBox> 
                </td></tr>
            <tr><td>收费类型</td><td>
            <asp:DropDownList ID="ddlPaymentType" runat="server">
                </asp:DropDownList> 
                </td><td>配件来源属性</td><td>
            <asp:DropDownList ID="ddlAccessoryResource" runat="server">
                </asp:DropDownList> 
                </td></tr>
            <tr><td>下定备注</td><td colspan="3">
                <asp:TextBox ID="txtRemark" runat="server"></asp:TextBox>
                </td></tr>
            <tr><td colspan="4" align="center">
                <asp:Button ID="btnSave" runat="server" Text="下定" CssClass="button" OnClick="btnSave_Click" />
                &nbsp;&nbsp;
                <asp:Button ID="btnCancel" runat="server" Text="取消" CssClass="button" OnClientClick="CloseWindow();"/>
                </td></tr>
        </table>
    </div>
 
    <asp:HiddenField runat="server" ID="hiddenRegisterID" />  
    <asp:HiddenField runat="server" ID="hiddenMaintainID" />
</asp:Content>
